package com.svse.designPattern.behaviour.observer.service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/8 11:48
 */
abstract public class Subject {

    protected List<Observer> observerList=new ArrayList<Observer>();

    public void add(Observer observer){
        observerList.add(observer);
    }
    public void remove(Observer observer){
        observerList.remove(observer);
    }
    public abstract void notifyObserver(); //通知观察者方法
}
